/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author niit
 */
@Entity
@Table(name = "fl_query")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "FlQuery.findAll", query = "SELECT f FROM FlQuery f"),
    @NamedQuery(name = "FlQuery.findByQueryid", query = "SELECT f FROM FlQuery f WHERE f.queryid = :queryid"),
    @NamedQuery(name = "FlQuery.findByQueryText", query = "SELECT f FROM FlQuery f WHERE f.queryText = :queryText"),
    @NamedQuery(name = "FlQuery.findByDateOfQuery", query = "SELECT f FROM FlQuery f WHERE f.dateOfQuery = :dateOfQuery"),
    @NamedQuery(name = "FlQuery.findByResponseText", query = "SELECT f FROM FlQuery f WHERE f.responseText = :responseText"),
    @NamedQuery(name = "FlQuery.findByDateofResponse", query = "SELECT f FROM FlQuery f WHERE f.dateofResponse = :dateofResponse"),
    @NamedQuery(name = "FlQuery.findByTitle", query = "SELECT f FROM FlQuery f WHERE f.title = :title")})
public class FlQuery implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "queryid")
    private Integer queryid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 1000)
    @Column(name = "queryText")
    private String queryText;
    @Basic(optional = false)
    @NotNull
    @Column(name = "dateOfQuery")
    @Temporal(TemporalType.DATE)
    private Date dateOfQuery;
    @Size(max = 1000)
    @Column(name = "responseText")
    private String responseText;
    @Column(name = "dateofResponse")
    @Temporal(TemporalType.DATE)
    private Date dateofResponse;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 200)
    @Column(name = "title")
    private String title;
    @JoinColumn(name = "facultyid", referencedColumnName = "facultyid")
    @ManyToOne
    private FlFaculty facultyid;
    @JoinColumn(name = "studentid", referencedColumnName = "studentid")
    @ManyToOne(optional = false)
    private FlStudent studentid;

    public FlQuery() {
    }

    public FlQuery(Integer queryid) {
        this.queryid = queryid;
    }

    public FlQuery(Integer queryid, String queryText, Date dateOfQuery, String title) {
        this.queryid = queryid;
        this.queryText = queryText;
        this.dateOfQuery = dateOfQuery;
        this.title = title;
    }

    public Integer getQueryid() {
        return queryid;
    }

    public void setQueryid(Integer queryid) {
        this.queryid = queryid;
    }

    public String getQueryText() {
        return queryText;
    }

    public void setQueryText(String queryText) {
        this.queryText = queryText;
    }

    public Date getDateOfQuery() {
        return dateOfQuery;
    }

    public void setDateOfQuery(Date dateOfQuery) {
        this.dateOfQuery = dateOfQuery;
    }

    public String getResponseText() {
        return responseText;
    }

    public void setResponseText(String responseText) {
        this.responseText = responseText;
    }

    public Date getDateofResponse() {
        return dateofResponse;
    }

    public void setDateofResponse(Date dateofResponse) {
        this.dateofResponse = dateofResponse;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public FlFaculty getFacultyid() {
        return facultyid;
    }

    public void setFacultyid(FlFaculty facultyid) {
        this.facultyid = facultyid;
    }

    public FlStudent getStudentid() {
        return studentid;
    }

    public void setStudentid(FlStudent studentid) {
        this.studentid = studentid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (queryid != null ? queryid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FlQuery)) {
            return false;
        }
        FlQuery other = (FlQuery) object;
        if ((this.queryid == null && other.queryid != null) || (this.queryid != null && !this.queryid.equals(other.queryid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.FlQuery[ queryid=" + queryid + " ]";
    }
    
}
